<?php
include '../controllers/getMachine.php';
$machineId = $_REQUEST['machineId'];
$machine = getMachineById($machineId);
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>编辑机经</title>
<script src="../js/machinemanager.js"></script>
</head>
<body onLoad="javascript:document.reset()">
<a href="javascript:history.back(-1)">返回</a>
<hr />
<table border='2' rules='rows' align="center" cellpadding='8%'>
	<thead>
		<tr align="center">
			<th colspan="2">
			<h1>编辑机经</h1>
			</th>
		</tr>
	</thead>
	<tr>
		<td colspan="2" style='background-color: gray; height: 30px;'></td>
	</tr>
	<tr align="left">
		<td>标题</td>
		<td><input type="text" size="100" id="title"
			value="<?php echo $machine->title;?>"></input></td>
	</tr>
	<tr align="left">
		<td>时间说明</td>
		<td><input type="text" size="60" id="update"
			value="<?php echo $machine->update;?>"></input></td>
	</tr>
	<tr align="left">
		<td>题目类型</td>
		<td><select id="machineType">
			<option value="1"
			<?php if ($machine->machineType == 1) {
				echo "selected='selected'";
			}?>>阅读</option>
			<option value="2"
			<?php if ($machine->machineType == 2) {
				echo "selected='selected'";
			}?>>逻辑</option>
			<option value="3"
			<?php if ($machine->machineType == 3) {
				echo "selected='selected'";
			}?>>写作</option>
			<option value="4"
			<?php if ($machine->machineType == 4) {
				echo "selected='selected'";
			}?>>数学</option>
		</select></td>
	</tr>
	<tr align="center">
		<td colspan="2"><input id="content" name="content"
			style="display: none"
			value="<?php echo str_replace("\"","'",$machine->content);?>" /> <iframe
			id="Editor" name="Editor" src="../editor/editor.html?Id=content"
			frameBorder="0" marginHeight="0" marginWidth="0" scrolling="no"
			style="height: 350px; width: 100%"></iframe></td>
	</tr>
	<tr align="center">
		<td colspan="2">
		<div id="listeningDiv"><input type="button" value="更新机经"
			onclick="updateMachine(<?php echo $machineId;?>);"></input></div>
		</td>
	</tr>
</table>
</body>
</html>
